import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.RandomUtil;
import com.bigmodel.contant.AmdbId;
import com.bigmodel.contant.StepId;
import com.bigmodel.contant.SystemName;
import com.bigmodel.contant.VerbName;
import com.bigmodel.entity.QAEntity;
import com.bigmodel.util.ExcelUtil;
import com.bigmodel.util.FtlUtil;
import org.junit.Test;

import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.format.TextStyle;
import java.time.temporal.TemporalAdjusters;
import java.util.*;

public class DateTimeSFT_20240110_V1 {

    private final static String OUT_PATH = "D:\\javacode\\bigmodel\\bigmodel\\qa_datetime_20240110_v1\\";

    private final static String FREEMARKER_BASE_PATH = "sft/datatime_20240110_v1/";

    private static final int randomNumber = 20;


    private static List<String> verbList = null;
    private static List<String> systemNameList = null;
    private static List<String> nameList = null;
    private static List<String> stepIdList = null;

    private static final int HOUR12MAX = 12;
    private static final int HOUR23MAX = 23;
    private static final int MINUTE59MAX = 59;
    private static String[] chinese_0_59 = {"零", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八", "十九", "二十", "二十一", "二十二", "二十三", "二十四", "二十五", "二十六", "二十七", "二十八", "二十九", "三十", "三十一", "三十二", "三十三", "三十四", "三十五", "三十六", "三十七", "三十八", "三十九", "四十", "四十一", "四十二", "四十三", "四十四", "四十五", "四十六", "四十七", "四十八", "四十九", "五十", "五十一", "五十二", "五十三", "五十四", "五十五", "五十六", "五十七", "五十八", "五十九"};
    private static String[] number_0_59 = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59"};

    private static String[] chinese_0_12 = {"零", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二"};
    private static String[] number_0_12 = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"};

    private static String[] chinese_0_23 = {"零", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八", "十九", "二十", "二十一", "二十二", "二十三"};
    private static String[] number_0_23 = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23"};

    private static String[] chinese_1_30 = {"一", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八", "十九", "二十", "二十一", "二十二", "二十三", "二十四", "二十五", "二十六", "二十七", "二十八", "二十九", "三十"};
    private static String[] number_1_30 = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30"};


    static {
        systemNameList = ListUtil.toList(SystemName.LIST_ARRAY);
        verbList = ListUtil.toList(VerbName.LIST_ARRAY);
        nameList = ListUtil.toList(AmdbId.LIST_ARRAY);
        stepIdList = ListUtil.toList(StepId.LIST_ARRAY);
    }

    private static void T001() {
        String code = "T001";
        String category = "";

        List<QAEntity> qaEntityList = null;
        List<QAEntity> allEntityList = new ArrayList<>();

        //----------------------模板：查询*天前整天的流量-------------------------
        //----------------------示例：查询12天前整天的流量-------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int hour = 0; hour <= HOUR23MAX; hour++) {
                for (int minute = 0; minute <= MINUTE59MAX; minute++) {
                    Map<String, Object> map = new HashMap<>();
                    String time_template = "今天%s点过%s分";
                    map.put("starttimeStr", String.format(time_template, number_0_23[hour], number_0_59[minute]));
                    map.put("endtimeStr", null);
                    map.put("startHour", hour);
                    map.put("startMinute", minute);
                    map.put("endHour", hour);
                    map.put("endMinute", minute);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }
            }
            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }
        //----------------------模板：今天%s点过%s分-------------------------
        //----------------------示例：今天九点过九分-------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int hour = 0; hour <= HOUR23MAX; hour++) {
                for (int minute = 0; minute <= MINUTE59MAX; minute++) {
                    Map<String, Object> map = new HashMap<>();
                    String time_template = "今天%s点过%s分";
                    map.put("starttimeStr", String.format(time_template, chinese_0_23[hour], chinese_0_59[minute]));
                    map.put("endtimeStr", null);
                    map.put("startHour", hour);
                    map.put("startMinute", minute);
                    map.put("endHour", hour);
                    map.put("endMinute", minute);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }
            }
            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }

        {
            qaEntityList = new ArrayList<>();
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "今天";
            map.put("starttimeStr", starttimeStr);
            map.put("endtimeStr", null);
            map.put("startHour", 0);
            map.put("startMinute", 0);
            map.put("endHour", 23);
            map.put("endMinute", 59);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            allEntityList.addAll(qaEntityList);
        }

        //输出到excel
        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }


    private static void T002() {
        String code = "T002";
        String category = "";

        List<QAEntity> qaEntityList = null;
        List<QAEntity> allEntityList = new ArrayList<>();
        //----------------------模板：昨天%s点过%s分-------------------------
        //----------------------示例：昨天9点过9分-------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int hour = 0; hour <= HOUR23MAX; hour++) {
                for (int minute = 0; minute <= MINUTE59MAX; minute++) {
                    Map<String, Object> map = new HashMap<>();
                    String time_template = "昨天%s点过%s分";
                    map.put("starttimeStr", String.format(time_template, number_0_23[hour], number_0_59[minute]));
                    map.put("endtimeStr", null);
                    map.put("startHour", hour);
                    map.put("startMinute", minute);
                    map.put("endHour", hour);
                    map.put("endMinute", minute);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }
            }
            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }
        //----------------------模板：今天%s点过%s分-------------------------
        //----------------------示例：今天九点过九分-------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int hour = 0; hour <= HOUR23MAX; hour++) {
                for (int minute = 0; minute <= MINUTE59MAX; minute++) {
                    Map<String, Object> map = new HashMap<>();
                    String time_template = "昨天%s点过%s分";
                    map.put("starttimeStr", String.format(time_template, chinese_0_23[hour], chinese_0_59[minute]));
                    map.put("endtimeStr", null);
                    map.put("startHour", hour);
                    map.put("startMinute", minute);
                    map.put("endHour", hour);
                    map.put("endMinute", minute);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }
            }
            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }

        {
            qaEntityList = new ArrayList<>();
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "昨天";
            map.put("starttimeStr", starttimeStr);
            map.put("endtimeStr", null);
            map.put("startHour", 0);
            map.put("startMinute", 0);
            map.put("endHour", 23);
            map.put("endMinute", 59);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            allEntityList.addAll(qaEntityList);
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }

    private static void T003() {
        String code = "T003";
        String category = "";

        List<QAEntity> qaEntityList = null;
        List<QAEntity> allEntityList = new ArrayList<>();
        //----------------------模板：前天%s点过%s分-------------------------
        //----------------------示例：前天9点过9分-------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int hour = 0; hour <= HOUR23MAX; hour++) {
                for (int minute = 0; minute <= MINUTE59MAX; minute++) {
                    Map<String, Object> map = new HashMap<>();
                    String time_template = "前天%s点过%s分";
                    map.put("starttimeStr", String.format(time_template, number_0_23[hour], number_0_59[minute]));
                    map.put("endtimeStr", null);
                    map.put("startHour", hour);
                    map.put("startMinute", minute);
                    map.put("endHour", hour);
                    map.put("endMinute", minute);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }
            }
            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }
        //----------------------模板：前天%s点过%s分-------------------------
        //----------------------示例：前天九点过九分-------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int hour = 0; hour <= HOUR23MAX; hour++) {
                for (int minute = 0; minute <= MINUTE59MAX; minute++) {
                    Map<String, Object> map = new HashMap<>();
                    String time_template = "前天%s点过%s分";
                    map.put("starttimeStr", String.format(time_template, chinese_0_23[hour], chinese_0_59[minute]));
                    map.put("endtimeStr", null);
                    map.put("startHour", hour);
                    map.put("startMinute", minute);
                    map.put("endHour", hour);
                    map.put("endMinute", minute);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }
            }
            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }


        {
            qaEntityList = new ArrayList<>();
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "前天";
            map.put("starttimeStr", starttimeStr);
            map.put("endtimeStr", null);
            map.put("startHour", 0);
            map.put("startMinute", 0);
            map.put("endHour", 23);
            map.put("endMinute", 59);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            allEntityList.addAll(qaEntityList);
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }


    private static void T004() {
        String code = "T004";
        String category = "";

        List<QAEntity> qaEntityList = null;
        List<QAEntity> allEntityList = new ArrayList<>();
        //----------------------模板：明天%s点过%s分-------------------------
        //----------------------示例：明天9点过9分-------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int hour = 0; hour <= HOUR23MAX; hour++) {
                for (int minute = 0; minute <= MINUTE59MAX; minute++) {
                    Map<String, Object> map = new HashMap<>();
                    String time_template = "明天%s点过%s分";
                    map.put("starttimeStr", String.format(time_template, number_0_23[hour], number_0_59[minute]));
                    map.put("endtimeStr", null);
                    map.put("startHour", hour);
                    map.put("startMinute", minute);
                    map.put("endHour", hour);
                    map.put("endMinute", minute);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }
            }
            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }
        //----------------------模板：明天%s点过%s分-------------------------
        //----------------------示例：明天九点过九分-------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int hour = 0; hour <= HOUR23MAX; hour++) {
                for (int minute = 0; minute <= MINUTE59MAX; minute++) {
                    Map<String, Object> map = new HashMap<>();
                    String time_template = "明天%s点过%s分";
                    map.put("starttimeStr", String.format(time_template, chinese_0_23[hour], chinese_0_59[minute]));
                    map.put("endtimeStr", null);
                    map.put("startHour", hour);
                    map.put("startMinute", minute);
                    map.put("endHour", hour);
                    map.put("endMinute", minute);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }
            }
            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }


        {
            qaEntityList = new ArrayList<>();
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "明天";
            map.put("starttimeStr", starttimeStr);
            map.put("endtimeStr", null);
            map.put("startHour", 0);
            map.put("startMinute", 0);
            map.put("endHour", 23);
            map.put("endMinute", 59);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            allEntityList.addAll(qaEntityList);
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }


    /**
     * 日期描述： 明天、今天、后天、大后天、昨天、前天、大前天。 如不包含时间描述，则代表对应日期一整天<br/>
     * 时间描述： 9点, 9点15, 9点15到58, 9点15到10点15, 9点到10点, etc.
     */
    private static void T005() {
        String code = "T005";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        Object[][] dateDescriptors = new Object[][]{{"", 0}, {"明天", 1}, {"今天", 0}, {"后天", 2}, {"大后天", 3}, {"昨天", -1}, {"前天", -2}, {"大前天", -3}};


        for (int i = 0; i < randomNumber; i++) {
            Object[] endDateDescriptors = dateDescriptors[RandomUtil.randomInt(1, dateDescriptors.length - 1)];
            Object[] startDateDescriptor = dateDescriptors[RandomUtil.randomInt(1, dateDescriptors.length - 1)];
            String dateDescriptorName = (String) startDateDescriptor[0];
            int startDayStep = (int) startDateDescriptor[1];
            String endDateDescriptorName = (String) endDateDescriptors[0];
            int endDayStep = (int) endDateDescriptors[1];

            if ((int) endDateDescriptors[1] < (int) startDateDescriptor[1]) {
                endDateDescriptorName = dateDescriptorName;
                endDayStep = startDayStep;
                startDayStep = (int) endDateDescriptors[1];
                dateDescriptorName = (String) endDateDescriptors[0];
            }


            // 明天/后天/大后天
            {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName;

                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", startDayStep);
                map.put("endDay", startDayStep);
                map.put("startnumberHour", 0);
                map.put("startnumberMin", 0);
                map.put("endnumberHour", 23);
                map.put("endnumberMin", 59);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            // 明天到后天
            {

                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName, endtimestr = endDateDescriptorName;

                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", endtimestr);
                map.put("startDay", startDayStep);
                map.put("endDay", endDayStep);
                map.put("startnumberHour", 0);
                map.put("startnumberMin", 0);
                map.put("endnumberHour", 0);
                map.put("endnumberMin", 0);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            // 明天10点到后天10点
            {
                int starthour = RandomUtil.randomInt(0, 23);
                int startmin = RandomUtil.randomInt(0, 59);
                int endhour = RandomUtil.randomInt(0, 23);
                int endmin = RandomUtil.randomInt(0, 59);

                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName + starthour + "点" + startmin, endtimestr = endDateDescriptorName + endhour + '点' + endmin;

                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", endtimestr);
                map.put("startDay", startDayStep);
                map.put("endDay", endDayStep);
                map.put("startnumberHour", starthour);
                map.put("startnumberMin", startmin);
                map.put("endnumberHour", endhour);
                map.put("endnumberMin", endmin);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
        }


        for (Object[] dateDescriptor : dateDescriptors) {
            Object[] endDateDescriptors = dateDescriptors[RandomUtil.randomInt(0, dateDescriptors.length - 1)];
            String dateDescriptorName = (String) dateDescriptor[0];
            int startDayStep = (int) dateDescriptor[1];
            String endDateDescriptorName = (String) endDateDescriptors[0];
            int endDayStep = (int) endDateDescriptors[1];

            for (int i = 0; i < randomNumber; i++) {
                int hour = RandomUtil.randomInt(0, 23);
                int min = RandomUtil.randomInt(0, 59);

                // 明天9点， 后天9点15。 大后天9点15分和大后天9点15属于一个类别
                {
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = null;
                    if (min == 0) {
                        starttimeStr = dateDescriptorName + hour + "点";
                    } else {
                        starttimeStr = dateDescriptorName + hour + "点" + min;
                        int minStr = RandomUtil.randomInt(0, 2);
                        if (minStr == 1) {
                            starttimeStr += "分";
                        }
                    }
                    map.put("starttimeStr", starttimeStr);
                    map.put("endtimeStr", null);
                    map.put("startDay", startDayStep);
                    map.put("endDay", startDayStep);
                    map.put("startnumberHour", hour);
                    map.put("startnumberMin", min);
                    map.put("endnumberHour", hour);
                    map.put("endnumberMin", min);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }

                // 明天9点
                {
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = dateDescriptorName + hour + "点";
                    map.put("starttimeStr", starttimeStr);
                    map.put("endtimeStr", null);
                    map.put("startDay", startDayStep);
                    map.put("endDay", startDayStep);
                    map.put("startnumberHour", hour);
                    map.put("startnumberMin", 0);
                    map.put("endnumberHour", hour);
                    map.put("endnumberMin", 0);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }

                // 9点过5分
                {
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = null;
                    if (min >= 0) {
                        starttimeStr = dateDescriptorName + hour + "点过" + min;
                        int minStr = RandomUtil.randomInt(0, 2);
                        if (minStr == 1) {
                            starttimeStr += "分";
                        }
                        map.put("starttimeStr", starttimeStr);
                        map.put("endtimeStr", null);
                        map.put("startDay", startDayStep);
                        map.put("endDay", startDayStep);
                        map.put("startnumberHour", hour);
                        map.put("startnumberMin", min);
                        map.put("endnumberHour", hour);
                        map.put("endnumberMin", min);
                        String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                        String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                        qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                    }
                }


                // 明天9点15到58
                {
                    int endMin = RandomUtil.randomInt(1, 59);
                    // 数值交换
                    if (endMin < min) {
                        endMin = endMin + min;
                        min = endMin - min;
                        endMin = endMin - min;
                    }
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = dateDescriptorName + hour + "点" + min;
                    {
                        int minStr = RandomUtil.randomInt(0, 2);
                        if (minStr == 1) {
                            starttimeStr += "分";
                        }
                    }
                    String endtimeStr = "" + endMin;
                    {
                        int minStr = RandomUtil.randomInt(0, 2);
                        if (minStr == 1) {
                            endtimeStr += "分";
                        }
                    }

                    map.put("starttimeStr", starttimeStr);
                    map.put("endtimeStr", endtimeStr);
                    map.put("startDay", startDayStep);
                    map.put("endDay", startDayStep);
                    map.put("startnumberHour", hour);
                    map.put("startnumberMin", min);
                    map.put("endnumberHour", hour);
                    map.put("endnumberMin", endMin);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }

                // 后天9点15到10点58
                {
                    int endHour = RandomUtil.randomInt(1, 23);
                    int endMin = RandomUtil.randomInt(1, 59);
                    // 数值交换
                    if (endMin < min) {
                        endMin = endMin + min;
                        min = endMin - min;
                        endMin = endMin - min;
                    }
                    if (endHour < hour) {
                        endHour = endHour + hour;
                        hour = endHour - hour;
                        endHour = endHour - hour;
                    }
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = dateDescriptorName + hour + "点" + min;
                    {
                        int minStr = RandomUtil.randomInt(0, 2);
                        if (minStr == 1) {
                            starttimeStr += "分";
                        }
                    }
                    String endtimeStr = "" + endHour + '点' + endMin;
                    {
                        int minStr = RandomUtil.randomInt(0, 2);
                        if (minStr == 1) {
                            endtimeStr += "分";
                        }
                    }

                    map.put("starttimeStr", starttimeStr);
                    map.put("endtimeStr", endtimeStr);
                    map.put("startDay", startDayStep);
                    map.put("endDay", startDayStep);
                    map.put("startnumberHour", hour);
                    map.put("startnumberMin", min);
                    map.put("endnumberHour", endHour);
                    map.put("endnumberMin", endMin);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }

                // 后天9点到10点
                {
                    int endHour = RandomUtil.randomInt(1, 23);
                    int endMin = RandomUtil.randomInt(1, 59);
                    // 数值交换
                    if (endMin < min) {
                        endMin = endMin + min;
                        min = endMin - min;
                        endMin = endMin - min;
                    }
                    if (endHour < hour) {
                        endHour = endHour + hour;
                        hour = endHour - hour;
                        endHour = endHour - hour;
                    }
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = dateDescriptorName + hour + "点";
                    String endtimestr = endHour + "点";

                    map.put("starttimeStr", starttimeStr);
                    map.put("endtimeStr", endtimestr);
                    map.put("startDay", startDayStep);
                    map.put("endDay", startDayStep);
                    map.put("startnumberHour", hour);
                    map.put("startnumberMin", "0");
                    map.put("endnumberHour", endHour);
                    map.put("endnumberMin", "0");
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }

            }


        }

        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }


    private static void T006() {
        String code = "T006";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        {
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "今天到现在";
            map.put("starttimeStr", starttimeStr);
            map.put("endtimeStr", null);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
        }
        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }


    private static void T007() {
        String code = "T007";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        {
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "今天上午";
            map.put("starttimeStr", starttimeStr);
            map.put("endtimeStr", null);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
        }
        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }


    private static void T008() {
        String code = "T008";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();


        //----------------------模板：三天前%s点过%s分-------------------------
        //----------------------示例：三天前9点过9分-------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int hour = 0; hour <= HOUR23MAX; hour++) {
                for (int minute = 0; minute <= MINUTE59MAX; minute++) {
                    Map<String, Object> map = new HashMap<>();
                    String time_template = "三天前%s点过%s分";
                    map.put("starttimeStr", String.format(time_template, number_0_23[hour], number_0_59[minute]));
                    map.put("endtimeStr", null);
                    map.put("startHour", hour);
                    map.put("startMinute", minute);
                    map.put("endHour", hour);
                    map.put("endMinute", minute);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }
            }
            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }
        //----------------------模板：三天前%s点过%s分-------------------------
        //----------------------示例：三天前九点过九分-------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int hour = 0; hour <= HOUR23MAX; hour++) {
                for (int minute = 0; minute <= MINUTE59MAX; minute++) {
                    Map<String, Object> map = new HashMap<>();
                    String time_template = "三天前%s点过%s分";
                    map.put("starttimeStr", String.format(time_template, chinese_0_23[hour], chinese_0_59[minute]));
                    map.put("endtimeStr", null);
                    map.put("startHour", hour);
                    map.put("startMinute", minute);
                    map.put("endHour", hour);
                    map.put("endMinute", minute);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }
            }
            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }

        {
            qaEntityList = new ArrayList<>();
            Map<String, Object> map = new HashMap<>();
            String starttimeStr = "三天前";
            map.put("starttimeStr", starttimeStr);
            map.put("endtimeStr", null);
            map.put("startHour", 0);
            map.put("startMinute", 0);
            map.put("endHour", 23);
            map.put("endMinute", 59);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
        }

        allEntityList.addAll(qaEntityList);
        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }


    private static void T009() {
        String code = "T009";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        for (int i = 0; i < randomNumber; i++) {

            int year = RandomUtil.randomInt(2010, 2040);
            int month = RandomUtil.randomInt(1, 12);
            int day = RandomUtil.randomInt(1, 31);
            int hour = RandomUtil.randomInt(0, 23);
            int min = RandomUtil.randomInt(0, 59);
            int sec = RandomUtil.randomInt(0, 59);

            int[] middleMonth = new int[]{4, 6, 9, 11};
            int littleMonth = 2;

            if (month == littleMonth && day > 28) {
                day = 28;
            } else {
                for (int lm : middleMonth) {
                    if (lm == month && day > 30) {
                        day = 30;
                        break;
                    }
                }
            }

            {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "/" + month + "/" + day + " " + hour + ":" + min;
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startYear", "" + year);
                map.put("startMonth", month);
                map.put("startDay", day);
                map.put("startHour", hour);
                map.put("startMin", min);
                map.put("startSec", "0");
                map.put("endYear", "" + year);
                map.put("endMonth", month);
                map.put("endDay", day);
                map.put("endHour", hour);
                map.put("endMin", min);
                map.put("endSec", "0");
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "/" + month + "/" + day + " " + hour + ":" + min + ":" + sec;
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startYear", "" + year);
                map.put("startMonth", month);
                map.put("startDay", day);
                map.put("startHour", hour);
                map.put("startMin", min);
                map.put("startSec", sec);
                map.put("endYear", "" + year);
                map.put("endMonth", month);
                map.put("endDay", day);
                map.put("endHour", hour);
                map.put("endMin", min);
                map.put("endSec", sec);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "-" + month + "-" + day + " " + hour + ":" + min;
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startYear", "" + year);
                map.put("startMonth", month);
                map.put("startDay", day);
                map.put("startHour", hour);
                map.put("startMin", min);
                map.put("startSec", "0");
                map.put("endYear", "" + year);
                map.put("endMonth", month);
                map.put("endDay", day);
                map.put("endHour", hour);
                map.put("endMin", min);
                map.put("endSec", "0");
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "-" + month + "-" + day + " " + hour + ":" + min + ":" + sec;
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startYear", "" + year);
                map.put("startMonth", month);
                map.put("startDay", day);
                map.put("startHour", hour);
                map.put("startMin", min);
                map.put("startSec", sec);
                map.put("endYear", "" + year);
                map.put("endMonth", month);
                map.put("endDay", day);
                map.put("endHour", hour);
                map.put("endMin", min);
                map.put("endSec", sec);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
        }

        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }


    private static void T010() {
        String code = "T010";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();


        //----------------------模板：最近%s小时-------------------------
        //----------------------示例：最近9小时-------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int hour = 0; hour < HOUR23MAX; hour++) {
                Map<String, Object> map = new HashMap<>();
                String time_template = "最近%s小时";
                String starttimeStr = String.format(time_template, number_0_23[hour]);
                map.put("starttimeStr", starttimeStr);
                map.put("hour", hour);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));

            }
            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }

        //----------------------模板：最近%s小时-------------------------
        //----------------------示例：最近九小时-------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int hour = 0; hour < HOUR23MAX; hour++) {
                Map<String, Object> map = new HashMap<>();
                String time_template = "最近%s小时";
                String starttimeStr = String.format(time_template, chinese_0_23[hour]);
                map.put("starttimeStr", starttimeStr);
                map.put("hour", hour);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));

            }
            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }


    private static void T011() {
        String code = "T011";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        String[] dayArr = {"下午", "晚上"};
        for (String day : dayArr) {
            for (int x = 1; x <= 11; x++) {
                for (int y = 2; y <= 12; y++) {
                    if (y < x) {
                        continue;
                    }
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = day + x + "点到" + y + "点";
                    map.put("starttimeStr", starttimeStr);
                    map.put("startHour", x);
                    map.put("endHour", y);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }
            }
        }

        qaEntityList = random50List(qaEntityList);
        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }

    private static void T012() {
        String code = "T012";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        String[] dayArr = {"早上", "今天", "上午", "今早", "早晨"};

        for (String day : dayArr) {
            for (int x = 1; x <= 11; x++) {
                for (int y = 2; y <= 12; y++) {
                    if (y < x) {
                        continue;
                    }
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = day + x + "点到" + y + "点";
                    map.put("starttimeStr", starttimeStr);
                    map.put("startHour", x);
                    map.put("endHour", y);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                }
            }
        }

        qaEntityList = random50List(qaEntityList);
        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }

    private static void T013() {
        String code = "T013";
        String category = "";
        List<QAEntity> qaEntityList = null;
        List<QAEntity> allEntityList = new ArrayList<>();

        {
            qaEntityList = new ArrayList<>();
            for (int x = 1; x <= 10; x++) {
                Map<String, Object> map = new HashMap<>();
                String time_template = "%s小时内";
                map.put("starttimeStr", String.format(time_template, number_0_12[x]));
                map.put("startHour", x);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }
        {
            qaEntityList = new ArrayList<>();
            for (int x = 1; x <= 10; x++) {
                Map<String, Object> map = new HashMap<>();
                String time_template = "%s小时内";
                map.put("starttimeStr", String.format(time_template, chinese_0_12[x]));
                map.put("startHour", x);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        allEntityList = random50List(allEntityList);
        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }

    private static void T014() {
        String code = "T014";
        String category = "";
        List<QAEntity> qaEntityList = null;
        List<QAEntity> allEntityList = new ArrayList<>();

        {
            qaEntityList = new ArrayList<>();
            for (int hour = 0; hour <= HOUR12MAX; hour++) {
                Map<String, Object> map = new HashMap<>();
                String time_template = "%s点到现在";
                map.put("starttimeStr", String.format(time_template, number_0_12[hour]));
                map.put("startHour", hour);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }
        {
            qaEntityList = new ArrayList<>();
            for (int hour = 0; hour <= HOUR12MAX; hour++) {
                Map<String, Object> map = new HashMap<>();
                String time_template = "%s点到现在";
                map.put("starttimeStr", String.format(time_template, chinese_0_12[hour]));
                map.put("startHour", hour);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        allEntityList = random50List(allEntityList);
        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }


    private static void T015() {
        String code = "T015";
        String category = "";
        List<QAEntity> qaEntityList = null;
        List<QAEntity> allEntityList = new ArrayList<>();

        {
            qaEntityList = new ArrayList<>();
            for (int hour = 1; hour <= 10; hour++) {
                Map<String, Object> map = new HashMap<>();
                String time_template = "下午%s点";
                map.put("starttimeStr", String.format(time_template, number_0_12[hour]));
                map.put("startHour", hour);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }
        {
            qaEntityList = new ArrayList<>();
            for (int hour = 1; hour <= 10; hour++) {
                Map<String, Object> map = new HashMap<>();
                String time_template = "下午%s点";
                map.put("starttimeStr", String.format(time_template, chinese_0_12[hour]));
                map.put("startHour", hour);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }


        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }


    private static void T016() {
        String code = "T016";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        for (int startHour = 1; startHour <= 11; startHour++) {
            for (int endHour = 2; endHour <= 12; endHour++) {
                if (endHour <= startHour) {
                    continue;
                }
                Map<String, Object> map = new HashMap<>();
                String time_template = "%s-%s点";
                map.put("starttimeStr", String.format(time_template, startHour, endHour));
                map.put("startHour", startHour);
                map.put("endHour", endHour);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
        }

        if (qaEntityList.size() > 50) {
            qaEntityList = random50List(qaEntityList);
        }
        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }


    private static void T017() {
        String code = "T017";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        for (int startHour = 1; startHour <= 10; startHour++) {
            Map<String, Object> map = new HashMap<>();
            String time_template = "%s点左右";
            map.put("starttimeStr", String.format(time_template, startHour));
            map.put("startHour", startHour);
            String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
            String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
            qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
        }

        if (qaEntityList.size() > 50) {
            qaEntityList = random50List(qaEntityList);
        }
        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }

    private static void T018() {
        String code = "T018";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        for (int month = 6; month <= 10; month++) {
            for (int day = 12; day <= 20; day++) {
                Map<String, Object> map = new HashMap<>();
                String time_template = "%s月%s号";
                map.put("starttimeStr", String.format(time_template, month, day));
                map.put("month", month);
                map.put("day", day);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
        }

        if (qaEntityList.size() > 50) {
            qaEntityList = random50List(qaEntityList);
        }
        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }

    private static void T019() {
        String code = "T019";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();

        for (int i = 0; i < randomNumber; i++) {

            int year = RandomUtil.randomInt(2010, 2040);
            int month = RandomUtil.randomInt(1, 12);
            int day = RandomUtil.randomInt(1, 31);

            int[] middleMonth = new int[]{4, 6, 9, 11};
            int littleMonth = 2;

            if (month == littleMonth && day > 28) {
                day = 28;
            } else {
                for (int lm : middleMonth) {
                    if (lm == month && day > 30) {
                        day = 30;
                        break;
                    }
                }
            }

            {
                // rt: 2023/08/10
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "/" + month + "/" + day;
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("year", year + "");
                map.put("month", month + "");
                map.put("day", day + "");
                map.put("hour", "0");
                map.put("min", "0");
                map.put("seconds", "0");
                map.put("endHour", "23");
                map.put("endMin", "59");
                map.put("endSeconds", "59");

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            {
                // rt: 2023-08-10
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "-" + month + "-" + day;
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("year", year + "");
                map.put("month", month + "");
                map.put("day", day + "");
                map.put("hour", "0");
                map.put("min", "0");
                map.put("seconds", "0");
                map.put("endHour", "23");
                map.put("endMin", "59");
                map.put("endSeconds", "59");

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            {
                // rt: 2023年8月10日
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "年" + month + "月" + day + "日";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("year", year + "");
                map.put("month", month + "");
                map.put("day", day + "");
                map.put("hour", "0");
                map.put("min", "0");
                map.put("seconds", "0");
                map.put("endHour", "23");
                map.put("endMin", "59");
                map.put("endSeconds", "59");

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            {
                // rt: 2023年8月10号
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "年" + month + "月" + day + "号";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("year", year + "");
                map.put("month", month + "");
                map.put("day", day + "");
                map.put("hour", "0");
                map.put("min", "0");
                map.put("seconds", "0");
                map.put("endHour", "23");
                map.put("endMin", "59");
                map.put("endSeconds", "59");

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/prompt.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

        }

        ExcelUtil.createExcel(qaEntityList, OUT_PATH + code + ".xls");
    }


    private static void T020() {
        String code = "T020";
        String category = "";

        List<QAEntity> qaEntityList;
        List<QAEntity> allEntityList = new ArrayList<>();

        //----------------------模板：查询 *天 * *点 * 分 到*点 * 分的-------------------------
        //----------------------示例：查询前天下午九点14到昨天5点28的------------------------
        {
            Object[][] dateDescriptors = new Object[][]{{"今天", 0}, {"昨天", 1}, {"前天", 2}, {"大前天", 3}};
            qaEntityList = new ArrayList<>();
            for (int i = 0; i < 180; i++) {
                int hour = RandomUtil.randomInt(0, 10);
                Object[] endDateDescriptors = dateDescriptors[RandomUtil.randomInt(1, dateDescriptors.length - 1)];
                Object[] startDateDescriptor = dateDescriptors[RandomUtil.randomInt(1, dateDescriptors.length - 1)];
                String dateDescriptorName = (String) startDateDescriptor[0];
                int startDayStep = (int) startDateDescriptor[1];
                String endDateDescriptorName = (String) endDateDescriptors[0];
                int endDayStep = (int) endDateDescriptors[1];

                if ((int) endDateDescriptors[1] < (int) startDateDescriptor[1]) {
                    endDateDescriptorName = dateDescriptorName;
                    endDayStep = startDayStep;
                    startDayStep = (int) endDateDescriptors[1];
                    dateDescriptorName = (String) endDateDescriptors[0];
                }
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName + "下午" + hour + "点14到" + endDateDescriptorName + "早晨" + (hour + 2) + "点28";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", startDayStep);
                map.put("endDay", endDayStep);
                map.put("startHour", hour);
                map.put("startMinute", 14);
                map.put("endHour", hour + 2);
                map.put("endMinute", 28);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }


        //----------------------模板：查询 *天 * *点 * 分 到*点 * 分的-------------------------
        //----------------------示例：查询今天凌晨3点14到5点30的------------------------
        {
            Object[][] dateDescriptors = new Object[][]{{"今天", 0}, {"昨天", 1}, {"前天", 2}, {"大前天", 3}};
            qaEntityList = new ArrayList<>();

            for (int i = 0; i < 180; i++) {
                int hour = RandomUtil.randomInt(0, 10);
                Object[] startDateDescriptor = dateDescriptors[RandomUtil.randomInt(0, dateDescriptors.length - 1)];
                String dateDescriptorName = (String) startDateDescriptor[0];
                int startDayStep = (int) startDateDescriptor[1];
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName + "晚上" + hour + "点14到" + (hour + 2) + "点28";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", startDayStep);
                map.put("endDay", startDayStep);
                map.put("startHour", hour);
                map.put("startMinute", 14);
                map.put("endHour", hour + 2);
                map.put("endMinute", 28);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }
        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }


    private static void T021() {
        String code = "T021";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();


        //----------------------模板：查询*周一的-------------------------
        //----------------------示例：查询这周一的------------------------

        {
            for (int i = 0; i < 180; i++) {
                qaEntityList = new ArrayList<>();
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "这周一";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }

        //----------------------模板：查询*周一的-------------------------
        //----------------------示例：查询本周一的------------------------

        {
            for (int i = 0; i < 180; i++) {
                qaEntityList = new ArrayList<>();
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "本周一";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }
        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }

    private static void T022() {
        String code = "T022";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();

        //----------------------模板：查询2023/12/9 15:30 到现在的-------------------------
        //----------------------示例：查询2023/12/9 15:30 到现在的------------------------

        for (int i = 0; i < 10; i++) {

            int year = RandomUtil.randomInt(2010, 2024);
            int month = RandomUtil.randomInt(1, 12);
            int day = RandomUtil.randomInt(1, 31);
            int hour = RandomUtil.randomInt(0, 24);
            int minute =  RandomUtil.randomInt(0, 60);

            int[] middleMonth = new int[]{4, 6, 9, 11};
            int littleMonth = 2;

            if (month == littleMonth && day > 28) {
                day = 28;
            } else {
                for (int lm : middleMonth) {
                    if (lm == month && day > 30) {
                        day = 30;
                        break;
                    }
                }
            }

            {
                // rt: 2023/12/9 15:30 到现在
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "/" + month + "/" + day + hour + ":" + minute + "到现在";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("year", year + "");
                map.put("month", month + "");
                map.put("day", day + "");
                map.put("hour", hour + "");
                map.put("minute", minute + "");
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }

            {
                // rt: 2023-12-9 15:30 到现在
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "-" + month + "-" + day + hour + ":" + minute + "到现在";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("year", year + "");
                map.put("month", month + "");
                map.put("day", day + "");
                map.put("hour", hour + "");
                map.put("minute", minute + "");

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }

            {
                // rt: 2023年12月9日 15：30 到现在
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "年" + month + "月" + day + "日" + hour + ":" + minute + "到现在";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("year", year + "");
                map.put("month", month + "");
                map.put("day", day + "");
                map.put("hour", hour + "");
                map.put("minute", minute + "");

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }

            {
                // rt: 2023年12月9号 15：30 到现在
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "年" + month + "月" + day + "号" +  hour + ":" + minute + "到现在";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("year", year + "");
                map.put("month", month + "");
                map.put("day", day + "");
                map.put("hour", hour + "");
                map.put("minute", minute + "");

                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }

    private static void T023() {

        String code = "T023";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();

        //----------------------模板：查询1/5号的------------------------
        //----------------------示例：查询1/5号的------------------------
        {
            for (int i = 0; i < randomNumber; i++) {

                int month = RandomUtil.randomInt(1, 12);
                int day = RandomUtil.randomInt(1, 31);

                int[] middleMonth = new int[]{4, 6, 9, 11};
                int littleMonth = 2;

                if (month == littleMonth && day > 28) {
                    day = 28;
                } else {
                    for (int lm : middleMonth) {
                        if (lm == month && day > 30) {
                            day = 30;
                            break;
                        }
                    }
                }

                {
                    // rt: 1月5日的
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = month + "月" + day + "日";
                    ;
                    map.put("starttimeStr", starttimeStr);
                    map.put("endtimeStr", null);
                    map.put("month", month + "");
                    map.put("day", day + "");

                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                    allEntityList.addAll(qaEntityList);
                }

                {
                    // rt: 1月5号
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = month + "月" + day + "号";
                    ;
                    map.put("starttimeStr", starttimeStr);
                    map.put("endtimeStr", null);
                    map.put("month", month + "");
                    map.put("day", day + "");

                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                    allEntityList.addAll(qaEntityList);
                }
                ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
            }
        }
    }

    private static void T024() {

        String code = "T024";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();

        for (int i = 0; i < randomNumber; i++) {
            int year = RandomUtil.randomInt(2000, 2024);
            int month = RandomUtil.randomInt(1, 12);
            int day = RandomUtil.randomInt(1, 31);

            int[] middleMonth = new int[]{4, 6, 9, 11};
            int littleMonth = 2;

            if (month == littleMonth && day > 28) {
                day = 28;
            } else {
                for (int lm : middleMonth) {
                    if (lm == month && day > 30) {
                        day = 30;
                        break;
                    }
                }
            }

            //----------------------模板：查询*年*月份的-------------------------
            //----------------------示例：查询2023年12月份的------------------------

            {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = year + "年" + month + "月份";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("year", String.valueOf(year));
                map.put("month", month);
                map.put("day", 1);
                map.put("year", String.valueOf(year));
                map.put("month", month);
                map.put("endDay", 31);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }

            if (allEntityList.size() > 50) {
                allEntityList = random50List(allEntityList);
            }

            ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
        }
    }

    private static void T025() {
        String code = "T025";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();

        //----------------------模板：查询最近半个月的-------------------------
        //----------------------示例：查询最近半个月------------------------

        {
            qaEntityList = new ArrayList<>();

            for (int i = 0; i < 100; i++) {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "最近半个月";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", 15);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }


        //----------------------模板：查询最近*天的-------------------------
        //----------------------示例：查询最近10天的------------------------

        {
            qaEntityList = new ArrayList<>();
            for (int i = 1; i < 200; i++) {
                int day = RandomUtil.randomInt(1, 31);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "最近" + day + "天";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", day);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        {
            qaEntityList = new ArrayList<>();
            for (int i = 1; i < 200; i++) {
                int day = RandomUtil.randomInt(1, 31);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "过去" + day + "天";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", day);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        //----------------------模板：查询*天前到现在-------------------------
        //----------------------示例：查询11天前到现在的------------------------

        {
            qaEntityList = new ArrayList<>();
            for (int i = 1; i < 200; i++) {
                int day = RandomUtil.randomInt(1, 31);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = day + "天前到现在";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", day);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        {
            qaEntityList = new ArrayList<>();
            for (int i = 1; i < 200; i++) {
                int day = RandomUtil.randomInt(1, 31);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = day + "天前至现在";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", day);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        {
            qaEntityList = new ArrayList<>();
            for (int i = 1; i < 200; i++) {
                int day = RandomUtil.randomInt(1, 31);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = day + "天前-现在";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", day);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }


    private static void T026() {
        String code = "T026";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();
        //----------------------模板：查询最近*个月的-------------------------
        //----------------------示例：查询最近一个月------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int i = 1; i < 200; i++) {
                int month = RandomUtil.randomInt(1, 12);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "最近" + month + "个月";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", month);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        {
            qaEntityList = new ArrayList<>();
            for (int i = 1; i < 200; i++) {
                int month = RandomUtil.randomInt(1, 12);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "过去" + month + "个月";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", month);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        //----------------------模板：查询*个月前到现在-------------------------
        //----------------------示例：查询两个月前到现在------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int i = 1; i < 200; i++) {
                int month = RandomUtil.randomInt(1, 12);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "查询" + month + "个月前到现在";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", month);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        //----------------------模板：查询*个月前至现在-------------------------
        //----------------------示例：查询两个月前至现在------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int i = 1; i < 200; i++) {
                int month = RandomUtil.randomInt(1, 12);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "查询" + month + "个月前至现在";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", month);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        {
            qaEntityList = new ArrayList<>();
            for (int i = 1; i < 200; i++) {
                int month = RandomUtil.randomInt(1, 12);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "查询" + month + "个月前现在";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", month);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }


    private static void T027() {
        String code = "T027";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();


        //----------------------模板：最近%s小时-------------------------
        //----------------------示例：最近7个小时-------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int i = 0; i < 333; i++) {
                int hour = RandomUtil.randomInt(1, 24);
                Map<String, Object> map = new HashMap<>();
                String time_template = "最近%s小时";
                String starttimeStr = String.format(time_template, number_0_23[hour]);
                map.put("starttimeStr", starttimeStr);
                map.put("hour", hour);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));

            }
            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }

        //----------------------模板：最近%s小时-------------------------
        //----------------------示例：最近七个小时-------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int i = 0; i < 333; i++) {
                int hour = RandomUtil.randomInt(1, 24);
                Map<String, Object> map = new HashMap<>();
                String time_template = "最近%s小时";
                String starttimeStr = String.format(time_template, chinese_0_23[hour]);
                map.put("starttimeStr", starttimeStr);
                map.put("hour", hour);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));

            }
            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }

        {
            qaEntityList = new ArrayList<>();
            for (int i = 0; i < 333; i++) {
                int hour = RandomUtil.randomInt(1, 24);
                Map<String, Object> map = new HashMap<>();
                String time_template = "过去%s小时";
                String starttimeStr = String.format(time_template, chinese_0_23[hour]);
                map.put("starttimeStr", starttimeStr);
                map.put("hour", hour);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));

            }
            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }

    private static void T028() {
        String code = "T028";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();


        //----------------------模板：上个月*号到*号-------------------------
        //----------------------示例：上个月14号到17号-------------------------
        {
            qaEntityList = new ArrayList<>();
            for (int day = 1; day <= 1000; day++) {
                int i = RandomUtil.randomInt(1, 31);
                int j = RandomUtil.randomInt(1, 31);
                    if (i < j) {
                        Map<String, Object> map = new HashMap<>();
                        String time_template = "上个月" + i + "号到" + j + "号";
                        map.put("starttimeStr", time_template);
                        map.put("startDay", i);
                        map.put("endDay", j);
                        String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                        String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                        qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                    }
                }

            qaEntityList = random50List(qaEntityList);
            allEntityList.addAll(qaEntityList);
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }

    private static void T029() {

        //----------------------模板：*个星期前 *点 到 *点 *分-------------------------
        //----------------------示例：一个星期前9点到15点32分-------------------------

        String code = "T029";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();

        {
            qaEntityList = new ArrayList<>();
            for (int day = 1; day <= 1000; day++) {
                int i = RandomUtil.randomInt(1, 24);
                int j = RandomUtil.randomInt(1, 5);
                    Map<String, Object> map = new HashMap<>();
                    String starttimeStr = j + "个星期前" + i + "点到" + (j + 19) + "点" + (i + 36) + "分";
                    map.put("starttimeStr", starttimeStr);
                    map.put("endtimeStr", null);
                    map.put("week", j);
                    map.put("hour", i);
                    map.put("endHour", j + 19);
                    map.put("minute", i + 36);
                    String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                    String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                    qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            allEntityList.addAll(qaEntityList);
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");

    }


    private static void T030() {

        //----------------------模板：最近 * 分钟-------------------------
        //----------------------示例：最近20分钟-------------------------

        String code = "T030";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();

        {
            qaEntityList = new ArrayList<>();
            for (int day = 1; day <= 500; day++) {
                int i = RandomUtil.randomInt(1, 59);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "最近" + i + "分钟";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("minute", i);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            allEntityList.addAll(qaEntityList);
        }

        {
            qaEntityList = new ArrayList<>();
            for (int day = 1; day <= 500; day++) {
                int i = RandomUtil.randomInt(1, 59);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "过去" + i + "分钟";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("minute", i);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }

            allEntityList.addAll(qaEntityList);
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");

    }

    private static void T031() {

        String code = "T031";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();
        //----------------------示例：查询30天前上午11点半到晚上九点二十五------------------------

        {
            qaEntityList = new ArrayList<>();
            for (int day = 1; day <= 333; day++) {
                int i = RandomUtil.randomInt(1, 60);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = i + "天前上午11点半到晚上九点二十五";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", i);
                map.put("endDay", i);
                map.put("startHour", 11);
                map.put("startMinute", 30);
                map.put("endHour", 9);
                map.put("endMinute", 25);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        {
            qaEntityList = new ArrayList<>();
            for (int day = 1; day <= 333; day++) {
                int i = RandomUtil.randomInt(1, 30);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = i + "天前上午十一点半到晚上九点二十五";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", i);
                map.put("endDay", i);
                map.put("startHour", 11);
                map.put("startMinute", 30);
                map.put("endHour", 9);
                map.put("endMinute", 25);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        {
            qaEntityList = new ArrayList<>();
            for (int day = 1; day <= 333; day++) {
                int i = RandomUtil.randomInt(1, 30);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = i + "天前上午十一点半到晚上9点25";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", i);
                map.put("endDay", i);
                map.put("startHour", 11);
                map.put("startMinute", 30);
                map.put("endHour", 9);
                map.put("endMinute", 25);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }


    private static void T032() {
        String code = "T032";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();
        //----------------------模板：查询 *天 * *点一刻到*点半的-------------------------
        //----------------------示例：查询前天下午四点一刻到四点半的------------------------
        {
            qaEntityList = new ArrayList<>();
            Object[][] dateDescriptors = new Object[][]{{"", 0}, {"今天", 0}, {"昨天", 1}, {"前天", 2}, {"大前天", 3}};

            for (int i = 0; i < 333; i++) {
                Object[] startDateDescriptor = dateDescriptors[RandomUtil.randomInt(1, dateDescriptors.length - 1)];
                String dateDescriptorName = (String) startDateDescriptor[0];
                int startDayStep = (int) startDateDescriptor[1];

                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName + "下午" + 3 + "点一刻到" + 5 + "点半";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", startDayStep);
                map.put("endDay", startDayStep);
                map.put("startHour", 3);
                map.put("startMinute", 15);
                map.put("endHour", 5);
                map.put("endMinute", 30);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }

        {
            qaEntityList = new ArrayList<>();
            Object[][] dateDescriptors = new Object[][]{{"", 0}, {"今天", 0}, {"昨天", 1}, {"前天", 2}, {"大前天", 3}};

            for (int i = 0; i < 333; i++) {
                Object[] startDateDescriptor = dateDescriptors[RandomUtil.randomInt(1, dateDescriptors.length - 1)];
                String dateDescriptorName = (String) startDateDescriptor[0];
                int startDayStep = (int) startDateDescriptor[1];

                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName + "下午" + 3 + "点一刻至" + 5 + "点半";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", startDayStep);
                map.put("endDay", startDayStep);
                map.put("startHour", 3);
                map.put("startMinute", 15);
                map.put("endHour", 5);
                map.put("endMinute", 30);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }


        //----------------------模板：查询 *天 * *点一刻到*点半的-------------------------
        //----------------------示例：查询前天晚上九点一刻到九点半的------------------------
        {
            Object[][] dateDescriptors = new Object[][]{{"今天", 0}, {"昨天", 1}, {"前天", 2}, {"大前天", 3}};
            qaEntityList = new ArrayList<>();

            for (int i = 0; i < 333; i++) {
                Object[] startDateDescriptor = dateDescriptors[RandomUtil.randomInt(1, dateDescriptors.length - 1)];
                String dateDescriptorName = (String) startDateDescriptor[0];
                int startDayStep = (int) startDateDescriptor[1];
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName + "晚上" + 9 + "点一刻到" + 11 + "点半";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", startDayStep);
                map.put("endDay", startDayStep);
                map.put("startHour", 9);
                map.put("startMinute", 15);
                map.put("endHour", 11);
                map.put("endMinute", 30);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);

            }
        }

        {
            Object[][] dateDescriptors = new Object[][]{{"今天", 0}, {"昨天", 1}, {"前天", 2}, {"大前天", 3}};
            qaEntityList = new ArrayList<>();

            for (int i = 0; i < 333; i++) {
                Object[] startDateDescriptor = dateDescriptors[RandomUtil.randomInt(1, dateDescriptors.length - 1)];
                String dateDescriptorName = (String) startDateDescriptor[0];
                int startDayStep = (int) startDateDescriptor[1];
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName + "晚上" + 9 + "点一刻至" + 11 + "点半";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", startDayStep);
                map.put("endDay", startDayStep);
                map.put("startHour", 9);
                map.put("startMinute", 15);
                map.put("endHour", 11);
                map.put("endMinute", 30);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);

            }
        }

        //----------------------模板：查询 *天 * *点一刻到*点半的-------------------------
        //----------------------示例：查询前天晚上九点一刻到九点半的------------------------
        {
            Object[][] dateDescriptors = new Object[][]{{"今天", 0}, {"昨天", 1}, {"前天", 2}, {"大前天", 3}};
            qaEntityList = new ArrayList<>();

            for (int i = 0; i < 333; i++) {
                Object[] startDateDescriptor = dateDescriptors[RandomUtil.randomInt(1, dateDescriptors.length - 1)];
                String dateDescriptorName = (String) startDateDescriptor[0];
                int startDayStep = (int) startDateDescriptor[1];
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName + "下午" + 5 + "点一刻到" + 7 + "点半";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", startDayStep);
                map.put("endDay", startDayStep);
                map.put("startHour", 5);
                map.put("startMinute", 15);
                map.put("endHour", 7);
                map.put("endMinute", 30);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }

        {
            Object[][] dateDescriptors = new Object[][]{{"今天", 0}, {"昨天", 1}, {"前天", 2}, {"大前天", 3}};
            qaEntityList = new ArrayList<>();

            for (int i = 0; i < 333; i++) {
                Object[] startDateDescriptor = dateDescriptors[RandomUtil.randomInt(1, dateDescriptors.length - 1)];
                String dateDescriptorName = (String) startDateDescriptor[0];
                int startDayStep = (int) startDateDescriptor[1];
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName + "下午" + 5 + "点一刻至" + 7 + "点半";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", startDayStep);
                map.put("endDay", startDayStep);
                map.put("startHour", 5);
                map.put("startMinute", 15);
                map.put("endHour", 7);
                map.put("endMinute", 30);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }

        if (allEntityList.size() > 50) {
            allEntityList = random50List(allEntityList);
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }

    private static void T033() {
        String code = "T033";
        String category = "";

        List<QAEntity> qaEntityList;
        List<QAEntity> allEntityList = new ArrayList<>();

        //----------------------模板：查询上周*到本周*的-------------------------
        //----------------------示例：查询上周一到本周四的------------------------

        {
            for (int i = 0; i < 250; i++) {
                qaEntityList = new ArrayList<>();
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "上周一到本周四";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("week", "DayOfWeek.MONDAY");
                map.put("endWeek", "DayOfWeek.TUESDAY");
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }

        }

        {
            for (int i = 0; i < 250; i++) {
                qaEntityList = new ArrayList<>();
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "上周一至本周四";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("week", "DayOfWeek.MONDAY");
                map.put("endWeek", "DayOfWeek.TUESDAY");
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }

        }

        {
            for (int i = 0; i < 250; i++) {
                qaEntityList = new ArrayList<>();
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "上周四到本周一";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("week", "DayOfWeek.TUESDAY");
                map.put("endWeek", "DayOfWeek.MONDAY");
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }

        {
            for (int i = 0; i < 250; i++) {
                qaEntityList = new ArrayList<>();
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "上周一到本周三";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("week", "DayOfWeek.MONDAY");
                map.put("endWeek", "DayOfWeek.WEDNESDAY");
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }

        {
            for (int i = 0; i < 250; i++) {
                qaEntityList = new ArrayList<>();
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "上周一至本周三";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("week", "DayOfWeek.MONDAY");
                map.put("endWeek", "DayOfWeek.WEDNESDAY");
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }

        {
            for (int i = 0; i < 250; i++) {
                qaEntityList = new ArrayList<>();
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "上周一到本周五";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("week", "DayOfWeek.MONDAY");
                map.put("endWeek", "DayOfWeek.FRIDAY");
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }

        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }

    private static void T034() {
        String code = "T034";
        String category = "";

        List<QAEntity> qaEntityList;
        List<QAEntity> allEntityList = new ArrayList<>();


        //----------------------模板：查询上个月*号到这个月*号的-------------------------
        //----------------------示例：查询上个月14号到这个月1号的------------------------

        {

            LocalDateTime today = LocalDateTime.now();
            for (int i = 1; i <= 1000; i++) {
                int day = RandomUtil.randomInt(1, 20);
                qaEntityList = new ArrayList<>();
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "上个月" + day + "号到这个月" + (day + 10) + "号";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", day);
                map.put("startHour", 0);
                map.put("startMin", 0);
                map.put("endDay", day + 10);
                map.put("endHour", 0);
                map.put("endMin", 0);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }
        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }

    private static void T035() {
        String code = "T035";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();

        for (int i = 0; i < 100; i++) {
            int month = RandomUtil.randomInt(1, 12);
            int day = RandomUtil.randomInt(1, 31);

            int[] middleMonth = new int[]{4, 6, 9, 11};
            int littleMonth = 2;

            if (month == littleMonth && day > 28) {
                day = 28;
            } else {
                for (int lm : middleMonth) {
                    if (lm == month && day > 30) {
                        day = 30;
                        break;
                    }
                }
            }
            //----------------------模板：查询*月份的-------------------------
            //----------------------示例：查询1月份的------------------------

            {
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = month + "月份";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("month", month);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }
        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }

    private static void T036(){
        String code = "T036";
        String category = "";
        //----------------------模板：查询%天前整天-------------------------
        //----------------------示例：查询12天前整天------------------------

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();

        {
            qaEntityList = new ArrayList<>();
            for (int i = 1; i < 180; i++) {
                int day = RandomUtil.randomInt(1, 30);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = day + "天前整天";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", day);
                map.put("endDay", day);
                map.put("startHour", 0);
                map.put("startMinute", 0);
                map.put("endHour", 23);
                map.put("endMinute", 59);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        //----------------------模板：*天的-------------------------
        //----------------------示例：昨天的------------------------

        {
            Object[][] dateDescriptors = new Object[][]{{"今天", 0}, {"昨天", 1}, {"前天", 2}, {"大前天", 3}};
            qaEntityList = new ArrayList<>();
            for (int i = 1; i < 180; i++) {
                Object[] startDateDescriptor = dateDescriptors[RandomUtil.randomInt(1, dateDescriptors.length - 1)];
                String dateDescriptorName = (String) startDateDescriptor[0];
                int startDayStep = (int) startDateDescriptor[1];
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName;
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", startDayStep);
                map.put("endDay", startDayStep);
                map.put("startHour", 0);
                map.put("startMinute", 0);
                map.put("endHour", 23);
                map.put("endMinute", 59);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        //----------------------模板：查询%天前-------------------------
        //----------------------示例：查询5天前------------------------

        {
            qaEntityList = new ArrayList<>();
            for (int i = 1; i < 180; i++) {
                int day = RandomUtil.randomInt(1, 30);
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = day + "天前";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", day);
                map.put("endDay", day);
                map.put("startHour", 0);
                map.put("startMinute", 0);
                map.put("endHour", 23);
                map.put("endMinute", 59);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }


        //----------------------模板：查询 *天 * *点 * 分 到*点 * 分的-------------------------
        //----------------------示例：查询昨天14点到今天9点的------------------------
        {
            Object[][] dateDescriptors = new Object[][]{{"今天", 0}, {"昨天", 1}, {"前天", 2}, {"大前天", 3}};
            qaEntityList = new ArrayList<>();
            for (int i = 0; i < 180; i++) {
                int hour = RandomUtil.randomInt(0, 10);
                Object[] endDateDescriptors = dateDescriptors[RandomUtil.randomInt(1, dateDescriptors.length - 1)];
                Object[] startDateDescriptor = dateDescriptors[RandomUtil.randomInt(1, dateDescriptors.length - 1)];
                String dateDescriptorName = (String) startDateDescriptor[0];
                int startDayStep = (int) startDateDescriptor[1];
                String endDateDescriptorName = (String) endDateDescriptors[0];
                int endDayStep = (int) endDateDescriptors[1];

                if ((int) endDateDescriptors[1] < (int) startDateDescriptor[1]) {
                    endDateDescriptorName = dateDescriptorName;
                    endDayStep = startDayStep;
                    startDayStep = (int) endDateDescriptors[1];
                    dateDescriptorName = (String) endDateDescriptors[0];
                }

                Map<String, Object> map = new HashMap<>();
                String starttimeStr = dateDescriptorName + hour + "点到" + endDateDescriptorName + (hour + 2) + "点";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startDay", startDayStep);
                map.put("endDay", endDayStep);
                map.put("startHour", hour);
                map.put("startMinute", 0);
                map.put("endHour", hour + 2);
                map.put("endMinute", 0);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
            }
            allEntityList.addAll(qaEntityList);
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }

    private static void T037(){
        String code = "T037";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();
        //----------------------模板：查询*周的-------------------------
        //----------------------示例：查询上周的------------------------

        {
            for (int i = 0; i < 180; i++) {
                qaEntityList = new ArrayList<>();
                Map<String, Object> map = new HashMap<>();
                LocalDateTime today = LocalDateTime.now();
                today.minusWeeks(1);
                // 获取本周一的日期
                LocalDateTime monday = today.with(DayOfWeek.MONDAY).minusDays(7);


                String starttimeStr = "上周";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                map.put("startYear", String.valueOf(monday.getYear()));
                map.put("startMonth", monday.getMonth().getValue());
                map.put("startDay", monday.getDayOfMonth());
                map.put("startHour", 0);
                map.put("startMin", 0);
                map.put("endYear", String.valueOf(monday.getYear()));
                map.put("endMonth", monday.getMonth().getValue());
                map.put("endDay", monday.getDayOfMonth());
                map.put("endHour", 0);
                map.put("endMin", 0);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }

    private static void T038(){
        String code = "T038";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();
        //----------------------模板：查询*周的-------------------------
        //----------------------示例：查询这周的------------------------

        {
            for (int i = 0; i < 180; i++) {
                qaEntityList = new ArrayList<>();
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "这周";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }

    private static void T039(){
        String code = "T039";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();
        //----------------------模板：查询本月的-------------------------
        //----------------------示例：查询本月的------------------------


        {
            for (int i = 0; i < 180; i++) {
                qaEntityList = new ArrayList<>();
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "本月";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }

        //----------------------模板：查询本月的-------------------------
        //----------------------示例：查询月初到现在的------------------------

        {
            for (int i = 0; i < 180; i++) {
                qaEntityList = new ArrayList<>();
                Map<String, Object> map = new HashMap<>();
                String starttimeStr = "月初到现在";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }


        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }

    private static void T040(){
        String code = "T040";
        String category = "";

        List<QAEntity> qaEntityList = new ArrayList<>();
        List<QAEntity> allEntityList = new ArrayList<>();
        //----------------------模板：查询*月的-------------------------
        //----------------------示例：查询上月的------------------------

        {
            for (int i = 0; i < 180; i++) {
                qaEntityList = new ArrayList<>();
                Map<String, Object> map = new HashMap<>();

                String starttimeStr = "上月";
                map.put("starttimeStr", starttimeStr);
                map.put("endtimeStr", null);
                String questionContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/question.ftl");
                String answerContent = FtlUtil.generateContent(map, FREEMARKER_BASE_PATH + code + "/answer.ftl");
                qaEntityList.add(new QAEntity(code, category, questionContent, answerContent));
                allEntityList.addAll(qaEntityList);
            }
        }

        ExcelUtil.createExcel(allEntityList, OUT_PATH + code + ".xls");
    }


    public static void main(String[] args) {
        T020(); //查询12天前整天  昨天的 查询5天前  昨天14点到今天9点的
        T021(); //查询月初到现在的  查询本周一的 查询这周一的
        T022(); //2023年12月9号 15：30 到现在
        T023(); // 1月5号的
        T024(); //查询1月份的  查询2023年12月份的
        T025(); //查询最近半个月的 查询最近10天的 查询11天前到现在的
        T026(); //查询两个月前到现在   查询最近一个月
        T027(); //最近7个小时
        T028(); // 上个月14号到17号
        T029();//一个星期前9点到15点32分
        T030();//最近多少分钟
        //可能样本量会偏多
        T031();// 查询30天前上午11点半到晚上九点二十五 查询前天下午九点14到昨天5点28的   查询今天凌晨3点14到5点30的
        T032();////查询前天下午四点一刻到四点半的  前天晚上九点一刻到九点半的
        T033();
        T034();
        T035();
        T036();
        T037();
        T038();
        T039();
        T040();
    }


    @Test
    public void test1() {
        //获取基准时间
        LocalDateTime now = LocalDateTime.now().withMonth(8).withDayOfMonth(12);
        //步骤一:开始时间计算
        //步骤一:开始时间计算
        LocalDateTime startTime = now.minusHours(3);
        //步骤二:结束时间计算
        LocalDateTime endTime = now;
        //步骤三:格式化开始时间,结束时间
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String startTimeStr = formatter.format(startTime);
        String endTimeStr = formatter.format(endTime);
        System.out.println(startTimeStr);
        System.out.println(endTimeStr);
    }


    @Test
    public void test2() {
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime localDateTime = now.minusWeeks(1).with(DayOfWeek.MONDAY);
        LocalDateTime of1 = LocalDateTime.of(now.getYear(), now.getMonthValue(), 1, 0, 0);

        LocalDateTime.of(now.minusMonths(1).getYear(),now.minusMonths(1).getMonthValue(),1,0,0);
        LocalDateTime of = LocalDateTime.of(now.minusMonths(1).getYear(), now.minusMonths(1).getMonthValue(), YearMonth.of(now.getYear(), now.minusMonths(1).getMonthValue()).lengthOfMonth(), 23, 59);
        System.out.println(of);
    }

    public static List<QAEntity> random50List(List<QAEntity> allList) {
        if (allList.size() > 230) {
            List<QAEntity> newList = new ArrayList<>();
            for (int i = 0; i < 230; i++) {
                newList.add(allList.get(RandomUtil.randomInt(0, allList.size())));
            }
            return newList;
        } else {
            return allList;
        }
    }


    @Test
    public void test3() {
        LocalDateTime now = LocalDateTime.now();
        LocalDateTime.of(2023, 10, 10, 17, 20);
        now.plusDays(3).toLocalDate().atTime(8, 0, 0);

        System.out.println(now.toLocalDate().atTime(23, 59));

        System.out.println(now.plusDays(-1).toLocalDate().atTime(10, 10));

        for (int i = 0; i < 80; i++) {
            System.out.println(RandomUtil.randomInt(0, 2));
        }

    }

}
